<html>
 <head>
  <link href="./leetcode-problem.css" rel="stylesheet" type="text/css">
 </head>
 <body>
  <div class="question_difficulty">
   难度：Easy
  </div>
  <div>
   <h1 class="question_title">
    908. Middle of the Linked List
   </h1>
   <p>
    Given a non-empty, singly&nbsp;linked list with head node
    <code>
     head
    </code>
    , return&nbsp;a&nbsp;middle node of linked list.
   </p>
   <p>
    If there are two middle nodes, return the second middle node.
   </p>
   <p>
    &nbsp;
   </p>
   <div>
    <p>
     <strong>
      Example 1:
     </strong>
    </p>
    <pre>
<strong>Input: </strong><span id="example-input-1-1">[1,2,3,4,5]</span>
<strong>Output: </strong>Node 3 from this list (Serialization: <span id="example-output-1">[3,4,5]</span>)
The returned node has value 3.  (The judge's serialization of this node is [3,4,5]).
Note that we returned a ListNode object ans, such that:
ans.val = 3, ans.next.val = 4, ans.next.next.val = 5, and ans.next.next.next = NULL.
</pre>
    <div>
     <p>
      <strong>
       Example 2:
      </strong>
     </p>
     <pre>
<strong>Input: </strong><span id="example-input-2-1">[1,2,3,4,5,6]</span>
<strong>Output: </strong>Node 4 from this list (Serialization: <span id="example-output-2">[4,5,6]</span>)
Since the list has two middle nodes with values 3 and 4, we return the second one.
</pre>
     <p>
      &nbsp;
     </p>
     <p>
      <strong>
       Note:
      </strong>
     </p>
     <ul>
      <li>
       The number of nodes in the given list will be between
       <code>
        1
       </code>
       &nbsp;and
       <code>
        100
       </code>
       .
      </li>
     </ul>
    </div>
   </div>
  </div>
  <div>
   <h1 class="question_title">
    908. 链表的中间结点
   </h1>
   <p>
    给定一个带有头结点&nbsp;
    <code>
     head
    </code>
    &nbsp;的非空单链表，返回链表的中间结点。
   </p>
   <p>
    如果有两个中间结点，则返回第二个中间结点。
   </p>
   <p>
    &nbsp;
   </p>
   <p>
    <strong>
     示例 1：
    </strong>
   </p>
   <pre><strong>输入：</strong>[1,2,3,4,5]
<strong>输出：</strong>此列表中的结点 3 (序列化形式：[3,4,5])
返回的结点值为 3 。 (测评系统对该结点序列化表述是 [3,4,5])。
注意，我们返回了一个 ListNode 类型的对象 ans，这样：
ans.val = 3, ans.next.val = 4, ans.next.next.val = 5, 以及 ans.next.next.next = NULL.
</pre>
   <p>
    <strong>
     示例&nbsp;2：
    </strong>
   </p>
   <pre><strong>输入：</strong>[1,2,3,4,5,6]
<strong>输出：</strong>此列表中的结点 4 (序列化形式：[4,5,6])
由于该列表有两个中间结点，值分别为 3 和 4，我们返回第二个结点。
</pre>
   <p>
    &nbsp;
   </p>
   <p>
    <strong>
     提示：
    </strong>
   </p>
   <ul>
    <li>
     给定链表的结点数介于&nbsp;
     <code>
      1
     </code>
     &nbsp;和&nbsp;
     <code>
      100
     </code>
     &nbsp;之间。
    </li>
   </ul>
  </div>
 </body>
</html>